package com.fancy.projecty.controller;

import com.fancy.projecty.mapper.ActReDeploymentMapper;
import com.fancy.projecty.pojo.ActReDeployment;
import com.fancy.projecty.util.SuccessVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/processDefinition")
@RestController
@CrossOrigin
@Api(tags = "流程定义")
public class ProcessDefinitionController {


	@Autowired
	/*执行管理、包括启动、推进、删除流程实例等操作*/
	private RuntimeService runtimeService;
	//	@Autowired
//	private ProcessDefinitionMapper processDefinitionMapper;
//	ACT_RE_DEPLOYMENT
	@Autowired
	private ActReDeploymentMapper actReDeploymentMapper;

	@ApiOperation(value = "查询所有的流程定义")
	@GetMapping("/selectAll")
	public SuccessVo selectByPage() {

		List<ActReDeployment> list = this.actReDeploymentMapper.selectAll();
		return new SuccessVo(list);
	}

	@Autowired
	/*管理流程定义,部署相关的Service*/
	private RepositoryService repositoryService;

	@Autowired
	/*任务管理,可以做任务的查询的*/
	private TaskService taskService;


}
